﻿using System.Collections.Generic;
using System.Linq;

namespace Models
{
    public class GenericItemCollection
    {
        #region Fields

        private List<GenericItem> _genericItems;

        #endregion

        #region Creation

        public GenericItemCollection(List<GenericItem> inputGenericItems)
        {
            _genericItems = inputGenericItems;
        }

        #endregion

        #region Public Methods

        public List<GenericItem> GetGenericItems()
        {
            return _genericItems;
        }

        public GenericItem GetGenericItemFromId(int id)
        {
            return _genericItems.First(e => e.Id == id);
        }

        #endregion
    }
}
